<?php

namespace App\Services\RefuseProductOrderRefund;

use App\Models\OrderRefund;

class RefuseProductOrderRefund
{
	protected $refund;
	
	public function __construct(OrderRefund $refund)
	{
		$this->refund = $refund;
	}
	
	protected function handle()
	{
		$refund = $this->refund;
		
		if ($refund->refund_status != 'applied') return;
		
		$refund->update(['refund_status' => 'refused']);
	}
	
	public function refuse()
	{
		$this->handle();
	}
}
